<template>
    <view class="main_view">
        <view>
            <view v-for="(item,index) in list" :key="index" class="historyItem" @click="()=>{go_to_HistoryItem()}">
                <view>
                    <view>{{ item.cate }}</view>
                    <view style="margin-top: 2vw;">{{ item.time }}</view>
                </view>
                <img src="/src/icon/del.png" class="icon" alt="">
            </view>
        </view>
        <view class="no_exist">暂无数据~</view>
    </view>
</template>
<script lang="ts" setup>
import type {HistoryCate} from '@/types/history'
defineProps<{
    list:HistoryCate[]
}>()

const go_to_HistoryItem = () => {
    uni.navigateTo({url:"/pages/History/HistoryItem"})
}
</script>
<style scoped>
.main_view{
    height: 94vh;
    width: 100%;
    background-color: #1c1526;
    overflow: hidden;
    padding: 0 3vh;
    box-sizing: border-box;
    margin-top: 6vh;
}
.no_exist{
    margin-top: 5vh;
    color: #eee;
    text-align: center;
}
.historyItem{
    width: 100%;
    padding: 2vw 4vw;
    background-color: #532269;
    color: white;
    box-sizing: border-box;
    border-radius: 3vw;
    margin-top: 2vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 4vw;
}
.icon{
    width: 7vw;
    height: 7vw;
}
</style>